<template>
  <XMSearchBtn />
  <XMSearchHots />
  <XMTitle title="Games" />
  <XMListCard :gameJson="data" />
  <XMTitle title="Game Categories" />
  <XMCategory showMore />
</template>

<script lang="ts" setup>
import { useGA } from "~/composables/useGA";

const { categoryType } = useRoute().query;
const { trackEvent } = useGA();
const { hostName } = useConfigStore();
const { data } = await useFetch<ConfigJsonType>("/api/getGameByCatetory", {
  method: "POST",
  body: { hostName, categoryType },
});

trackEvent({
  eventName: "SearchResult_Page_Show",
  params: {
    KeyWord: categoryType,
  },
});
</script>

<style scoped></style>
